<!DOCTYPE HTML>
<html>
	<head>
		<script src="js/jquery-1.10.1.min.js"></script>
		<script>
			(function($, undefined) {
				$.extend({
					JSONP : function(url, data, callback, charset) {
						var script = document.createElement("script"), head = document.getElementsByTagName("head")[0] || document.documentElement, jsc = $.now(), randnum = Math.round(Math.random() * 1000), jsonp = ("jsonp" + randnum + jsc++);
						if (!callback) {
							callback = data;
							data = {};
						}
						if ($.isFunction(callback)) {
							window[jsonp] = callback;
							callback = jsonp;
						}
						if ( typeof data === "object") {
							data = $.param(data);
						}
						script.src = url + (url.indexOf("?") !== -1 ? "&" : "?") + "callback=" + callback + "&" + data;
						if (charset) {
							script.charset = charset;
						}
						var done = false;
						if (!done) {
							script.onload = script.onreadystatechange = function() {
								if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
									done = true;
									script.onload = script.onreadystatechange = null;
									head.removeChild(script);
									window[jsonp] = undefined;
									try {
										delete window[jsonp];
									} catch(jsonpError) {
									}
								}
							};
						}
						head.insertBefore(script, head.firstChild);
						return callback;
					},
					error : function(msg) {
						if (!$.debug) {
							if (!location.href.split("?")[1] || location.href.split("?")[1].indexOf("jsDebug") === -1) {
								return;
							} else {
								$.debug = true;
							}
						}
						if (!$.debugPanel) {
							var jsc = $.now();
							$.debugPanel = $("<div></div>").appendTo(document.body).attr("id", "debug-panel-" + jsc).addClass("jquery-debug-panel").css({
								position : "fixed",
								left : 0,
								top : 0,
								width : 500,
								height : 600,
								opacity : 0.8,
								fontFamily : "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif",
								fontSize : "10px",
								color : "#fff",
								background : "#000"
							});
							$.debugPanel.titlebar = $("<div></div>").appendTo($.debugPanel).addClass("jquery-debug-panel-titlebar").css({
								position : "relative",
								width : "100%",
								height : 30,
								cursor : "move",
								background : "#ff0"
							});
							$.debugPanel.closeButton = $("<div></div>").appendTo($.debugPanel.titlebar).addClass("jquery-debug-panel-close-button").css({
								position : "absolute",
								width : 45,
								height : 25,
								right : 5,
								top : 2,
								cursor : "pointer"
							}).text("关闭").bind("click", function() {
								$.debugPanel.hide();
							});
							$.debugPanel.content = $("<div></div>").appendTo($.debugPanel).addClass("jquery-debug-panel-content").css({
								position : "relative",
								overflowY : "auto"
							});
						}
						$("<span>" + msg + "</span></br>").appendTo($.debugPanel.content);
						$.debugPanel.show();
					},
					ns : function() {
						var a = arguments[0], o;
						if (!a) {
							return;
						}
						var b = a.split(".");
						var c = b[0];
						eval('if (typeof ' + c + ' == "undefined"){' + c + ' = {};} o = ' + c + ';');
						for (var i = 1; i < b.length; i++) {
							o[b[i]] = o[b[i]] || {};
							o = o[b[i]];
						}
					}
				});
			})(jQuery);
			$.JSONP('http://fed.hz.netease.com/api/getFriendsLatestBlogs', {
				userid : 126770605,
				t : 'jsonp'
			}, function(json) {
                console.log(json)
			})
		</script>
	</head>
	<body>
		<!--<script type="text/javascript">
			//添加<script>标签的方法
			function addScriptTag(src) {
				var script = document.createElement('script');
				script.setAttribute("type", "text/javascript");
				script.src = src;
				document.body.appendChild(script);
			}


			window.onload = function() {
				//搜索apple，将自定义的回调函数名result传入callback参数中
				addScriptTag("http://act.city.sina.com.cn/interface/activity/json_update_visite_count.php?id=6915&callback=result");

			}
			//自定义的回调函数result
			function result(data) {
				//我们就简单的获取apple搜索结果的第一条记录中url数据
				console.log(data);
			}
		</script>-->
	</body>
</html>